package com.ss.android.article.base.feature.user.account.presenter;

import android.text.TextUtils;
import com.bytedance.retrofit2.Callback;
import com.bytedance.retrofit2.ResponseWrapper;
import com.ss.android.account.model.AccountResponseModel;
import com.ss.android.account.model.UserAuditModel;

final class a implements Callback {
    private final AccountEditPresenter a;

    a(AccountEditPresenter arg1) {
        this.a = arg1;

    }

    public final void onCacheResponse(ResponseWrapper response) {
        if(response.body != null && (((AccountResponseModel) response.body).isApiSuccess())) {
            AccountEditPresenter.a(this.a, (UserAuditModel) ((AccountResponseModel) response.body).getData());
            AccountEditPresenter.a(this.a, true);
        } else if(response.body != null) {
            Object v0 = ((AccountResponseModel) response.body).getData();
            if(v0 != null && !TextUtils.isEmpty(((UserAuditModel)v0).getDescription())) {
                this.a.a(((UserAuditModel)v0).getDescription());
            }
        }

        AccountEditPresenter.a(this.a);
        this.a.d = false;
        AccountEditPresenter.b(this.a);
    }

    public final void onErrorResponse(Throwable throwable) {
        this.a.d = false;
        AccountEditPresenter.b(this.a);
    }
}

